package database;

import interfaces.SQLiteLoader;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import org.joda.time.DateTime;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import data.Athlete;
import data.Competition;
import data.Event;
import data.Relay;
import data.Result;
import data.Team;

public abstract class DataController implements SQLiteLoader{

	public static final int DATABASE_HY_TEK = 1;
	public static final int DATABASE_SPLASH = 2;
	
	protected Connection connection;

	protected DataController(Connection connection) {
		this.connection = connection;
	}
	
	public static DataController fromType(int type, Connection connection) {
		switch (type) {
		case DATABASE_HY_TEK:
			return new HY_TEK_databaseController(connection);
			
		case DATABASE_SPLASH:
			return new Splash_databaseController(connection);

		}
		
		return null;
	}

	@Override
	public abstract String loadCompetition() throws SQLException;
	
	@Override
	public abstract List<Event> loadEvents() throws SQLException;

	@Override
	public abstract String loadAthletes() throws SQLException;

	@Override
	public abstract String loadTeams() throws SQLException;

	@Override
	public abstract List<Result> loadResults() throws SQLException;

	@Override
	public abstract List<Relay> loadRelays() throws SQLException;

	

}
